﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net;

namespace Uniriotec.DC.CoordDist.Base
{
    class IPHelper
    {

        public static IPAddress GetIP(string hostname)
        {
            hostname = (hostname == String.Empty) ? Dns.GetHostName() : hostname;

            try
            {
                return Dns.GetHostEntry(hostname).AddressList[0];
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            return null;
        }

    }
}
